package com.kellyfeng.account.captcha;

import java.util.List;

public interface AccountCaptchaService {
	/**
	 * @return 生成随机验证码主键,主键仅仅是标识验证码图片,本身没有实际意义.
	 * @throws AccountCaptchaException
	 */
	String generateCaptchaKey() throws AccountCaptchaException;

	/**
	 * @param captchaKey 验证码主键
	 * @return	生成验证码图片
	 * @throws AccountCaptchaException
	 */
	byte[] generateCaptchaImage(String captchaKey) throws AccountCaptchaException;

	/**
	 * @param captchaKey 主键
	 * @param captchaValue 反馈的值
	 * @return	验证用户反馈的主键和值
	 * @throws AccountCaptchaException
	 */
	boolean validateCaptcha(String captchaKey, String captchaValue) throws AccountCaptchaException;

	/**
	 * @return 预定义
	 */
	List<String> getPreDefinedTexts();

	/**
	 * @param preDefinedTexts 预定义
	 */
	void setPreDefinedTexts(List<String> preDefinedTexts);
}